<template>
  <div>
    <!-- 3.遍历数据  -->
    <div>
      <van-tabs>
        <van-tab title="热门推荐" name="a">
          <v-card v-if="arr.length>0" :arr="arr[0].content" ></v-card>
        </van-tab>
        <van-tab title="上新推荐" name="b">
          <v-card  v-if="arr.length>0" :arr="arr[1].content"></v-card>
        </van-tab>
        <van-tab title="所有商品" name="c">
          <v-card  v-if="arr.length>0" :arr="arr[2].content"></v-card>
        </van-tab>
      </van-tabs>
    </div>
  </div>
</template>

<script>
// import axios from "axios";
import { reqhomegoods } from "../../../http/http";
export default {
  data() {
    return {
      arr: [],
    };
  },
  methods: {},
  mounted() {
    reqhomegoods().then((res) => {
      // console.log(res);
      this.arr = res.data.list;
    });
  },
};
</script>

<style lang="less" scoped>
@import "../../../less/index.less";
.hd {
  text-align: center;
}
.btn {
  padding: 0.1rem 0.2rem;
}
.con {
  width: 5rem;
  padding: 0.05rem 0.1rem;
  background-color: @primary-light;
  text-align: center;
  margin: 0.3rem auto;
  border-radius: 0.2rem;
}
img {
  width: 100%;
}
</style>